//Copyright (C) 2010 Workplicity, contact: ronncoleman@gmail.com
//
//This library is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either
//version 3 of the License, or (at your option) any later version.
//
//This library is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this library; if not, write to the Free Software
//Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

package org.workplicity.marist.print;

import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;
import org.workplicity.entry.WorkSlate;
import org.workplicity.marist.grounds.GroundsRequest;
import org.workplicity.util.WorkDate;

/**
 *
 * @author Ryan Flaherty
 */

public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        // TODO Auto-generated method stub

        //Create and populate a GroundsRequest object
            GroundsRequest request = new GroundsRequest();
            WorkSlate workSlate = new WorkSlate();
            request.setId(70);
            request.setRequestedBy("Ron Coleman");
            request.setApprovedBy("Ryan Flaherty");
            request.setLocation("Lowell Thomas");
            request.setDescr("Components Guide: A visual design guide for the LZ components, including detailed explanations of their construction." +
                    " In the OpenLaszlo 4.3 or higher " +
                    "releases, this information is included in the Software Developer's Guide and no longer exists as a separate manual." +
                    "Components Guide: A visual design guide for the LZ components, including detailed explanations of their construction." +
                    " In the OpenLaszlo 4.3 or higher " +
                    "releases, this information is included in the Software Developer's Guide and no longer exists as a separate manual.");

            request.setMaterials("Ubuntu is a free, open source Linux-based operating system that starts with the breadth of Debian and adds regular releases"
                    + " (every six months), a clear focus on the user and usability (it should \"Just Work\", TM) and a commitment to security updates with 18 "
                    + "months of support for every release (and with 6.06 LTS and 8.04 LTS you get 3 years on the desktop and 5 on the server!). "
                    + "The current verson is 9.10 the next version 10.04 (LTS) is due out on the 29th of April 2010. ");

            request.setAssignedDate(new WorkDate());
            request.setCompleteDate(new WorkDate());
            request.setCreateDate(new WorkDate());
            request.setDamageCause("word12345678910111213141516171819");

            request.setReason("Unknown_byuerbvieurbvbvbukbutyuyuebrvuyyvtwrbfuqbyurbuivyerubuerbrtugbyewbgu");
            request.setEstHours(37);
            request.setActHours(40);


	PrinterJob job = PrinterJob.getPrinterJob();
//	job.setPrintable(new MainPrinter(request, null, 5));
	job.setPrintable(new MainPrinter(null,null, null, null));
	boolean doPrint = job.printDialog();
	if (doPrint) {
            try {
            	job.print();
            }
            catch (PrinterException e) {
			/* The job did not successfully complete */
            }
        }
    }

}
